//
//  AddPayViewController.m
//  Hxcsfw
//
//  Created by 企友软mac on 2018/2/28.
//  Copyright © 2018年 企友软mac. All rights reserved.
//

#import "AddPayViewController.h"
#import "NetworkTopCell.h"
#import "NetworkBottomCell.h"

@interface AddPayViewController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong)UITableView *tableView;

@end

@implementation AddPayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.tableView];
}

- (UITableView *)tableView {

    if (_tableView == nil) {

        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, WSCREENH_WIDTH, WSCREENH_HEIGHT) style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        self.tableView.estimatedRowHeight =0;
        self.tableView.estimatedSectionHeaderHeight =0;
        self.tableView.estimatedSectionFooterHeight =0;
        _tableView.showsVerticalScrollIndicator = YES;
        _tableView.bounces = YES;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
    return _tableView;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

    if (indexPath.section == 0) {
        return 520;
    } else {
        return 550;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *identCell = @"NetworkPayCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identCell];

    if (indexPath.section == 0) {
        if (cell == nil) {
            NetworkTopCell *networkTopCell = [[[NSBundle mainBundle] loadNibNamed:@"NetworkTopCell" owner:self options:nil] lastObject];
            cell = networkTopCell;
        }
    }else if (indexPath.section == 1) {
        if (cell == nil) {
            NetworkBottomCell *networkBottomCell = [[[NSBundle mainBundle] loadNibNamed:@"NetworkBottomCell" owner:self options:nil] lastObject];
            cell = networkBottomCell;
        }
    }
    return cell;
}



@end
